home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
mntnc20.arc
/
STRIP10.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1986-01-05
|
4KB
|
151 lines
PROGRAM Strip10;
{
Production Version 1.0
(c) copyright 1985 J. Levine/ Atlantic Palisades
Colossus Net 200/ Node 7 (718) 238-7855. PUBLIC DOMAIN -- not for resale.
This is a utility to remove lines from answers.bbs which have entries
of less than 2 characters -- allows compact storage of old questionnaires.
}
VAR
Infile, Outfile : text;
oneline: string[255];
file1, file2 : string[14];
lines, short_lines : integer;
pct : real;
OK : boolean;
{--------------------------}
PROCEDURE linereader; {read lines, strip out short lines}
BEGIN
clrscr;
gotoxy(10,5);
Writeln(file1, ' --> ',file2);
WHILE NOT EOF(infile) DO
BEGIN
Readln(infile,oneline);
lines := lines+1;
IF Length(Oneline) > 4
THEN
BEGIN
Writeln(outfile,oneline);
Gotoxy(41,12);
ClrEOL;
gotoxy(41,10);
write('*');
gotoxy(10,10);
Write('Total Lines Copied = ',lines);
END
ELSE
BEGIN
short_lines := short_lines+1;
Gotoxy(41,10);
ClrEOL;
gotoxy(41,12);
write('*');
gotoxy(10,12);
Write('Total Lines Eliminated = ', short_lines);
END;
IF short_lines >1
THEN
BEGIN
gotoxy(10,14);
Writeln('Total Lines Processed = ', lines+short_lines);
gotoxy(10,16);
pct := short_lines / (lines+short_lines);
Write('Savings = ',pct*100:4:0,'%');
END;
END;
END;
{-----------------------------}
PROCEDURE Initialize;
BEGIN
clrscr;
gotoxy(5,1);
Writeln('Strip Utility for Colossus -- Public Domain -- Not for Resale');
gotoxy(5,2);
Writeln(' Production Ver. 1.0');
Gotoxy(5,3);
Writeln(' (c) Copyright 1985 J. Levine/ Atlantic Palisades');
Gotoxy(5,4);
Writeln(' Colossus Net 200/ Node 7 (718) 238-7855');
gotoxy(10,12);
Write('What is the input file name? ');
REPEAT
Readln(file1);
Assign(Infile,File1);
{$I-} Reset(infile) {$I+};
OK := IOresult = 0;
IF NOT OK
THEN
BEGIN
gotoxy(10,12);
Write(^g,'Input file does not exist! Please reenter: ')
END
ELSE
BEGIN
gotoxy(10,15);
Write ('What is the output file name? ');
REPEAT
Readln(file2);
IF file2 = file1
THEN
BEGIN
ok := False;
gotoxy(10,15);
clreol;
write(^g,' Same as Input File! Please reenter: ');
END
ELSE OK := TRUE;
UNTIL OK ;
Assign(Outfile,File2);
REPEAT
{$I-} Rewrite(outfile) {$I+};
OK := IOResult = 0;
IF NOT OK
THEN
BEGIN
gotoxy(10,15);
Writeln(^g,'Output file name invalid! Please reenter: ');
END;
UNTIL OK;
END;
UNTIL OK;
END;
{-------------------------------------------------------}
BEGIN
Initialize;
lines := 0;
short_lines := 0;
clrscr;
linereader;
Close(Infile);
Close(Outfile);
gotoxy(40,10);
clreol;
gotoxy(40,12);
clreol;
gotoxy(10,20);
Sound(2000);
Delay(200);
NoSound;
Sound(1000);
Delay(100);
NoSound;
Writeln('File Processed successfully');
END.